package com.ruoyi.web.controller.system;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.service.ISysChinaService;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/system/china")
public class SysChinaController {

    @Autowired
    private ISysChinaService sysChinaService;






    @GetMapping("/getJuniorData")
    public AjaxResult getJuniorData(HttpServletRequest request){
        String epProince = request.getParameter("epProince");
        if (StringUtils.isBlank(epProince)) {
            return AjaxResult.error("还没获取到省级数据，请重新获取");
        }
        List<Map<String, Object>> mapData = sysChinaService.getChild(Integer.getInteger(epProince));
        return AjaxResult.success(mapData);
    }



}
